Importing your UML class diagram to geodatabases

 

About creating table (logical design)

 

In Relational database,

You create ERD in visio, and then you write SQL to create tables (use CREATE TABLE statement), and specify PK, FK, and so on based on ERD.

 

In Object-oriented database,

You can immediately import UML class diagram to database specific to software if CASE tool is supported in the software. In this lab, we will create geodatabases (ArcGIS OODB model) from UML class diagram.

 

Three steps

(1)   [Visio] create a custom feature with UML

(2)   [Visio] import the UML package diagram into XMI

(3)   [ArcCatalog: Schema Wizard] create database schema from XMI

 

 

Download ArcInfo UML Model (Visio 2003).vst from www.esri.com (type in ArcInfo UML in the search input box) or copy from C:\Program Files\ArcGIS\CaseTools\Uml Models. Make sure you copy (not cut) the file, and save this into your working directory.

 

Open Visio and open the visio file you just downloaded.

It will open the ArcGIS UML Model. It contains the relevant parts of the geodata access components needed for the creation of custom features.

 

 

 

As you can see in the Model Explorer (lower left), the object model has four packages: Logical View, ESRI Classes, ESRI Interface, and Workspace. Think of these as directories where different parts of the entire object model are maintained. (remember package contains class diagram when we learn UML).

 

Open Classes Diagram by clicking ESRI Classes Diagram tab at the bottom

Browse through Classes Diagram. Each class represents COM* classes that belong to the geodata access components of ArcGIS.

 

*COM is Component Object Model that allows you to reuse program module across system.

 

Classes are organized in class hierarchy. For example, the following figure in the grid indicates that NetworkFeature is generalized into Feature, and Feature is generalized into Object. Following the concept of inheritance, subclass inherits properties or its implementation (through interface) from superclass. Object is nonspatial while features are spatial. For example, parcel and building will inherit from Feature, and thus they will implement all the interfaces that Feature does.

 

 

 

 

 

 

Creating a custom feature

 

You will create a UML class that represents the parcel custom feature and building features. You will need to create Workspace packages to hold geodatabases you will create.

 

1. Double click Workspace tab at the bottom. This is where you create your custom features.

 

2. From the stencil (upper left), drag and drop a package onto the grid. Double-click the package to open its properties. Type Landbase in the name box. Click the Stereotype* dropdown and click FeatureDataset. Click OK.

 

*Stereotype is modeling construct that is not supported in UML as an extensibility mechanism.

 

 

Stereotype is denoted << stereotypename >>

 

Double-click Static Structure-1 under Workspace in Model Explorer (or click Static Structure-1 tab in the bottom). As you can see, this will be contained in stereotype FeatureDataset you just created.

 

From ESRI Classes package (under Model Explorer at the left), drag and drop the Object class onto the grid

From ESRI Classes package (under Model Explorer at the left), drag and drop the Feature class onto the grid

 

From the UML Static Structure stencil, drag and drop a new class onto the diagram

 

Drag and drop a generalization onto the diagram and connect the new class to feature

 

 

Double-click the class to open its properties. Type Parcel in the name box. Click the Attributes. Type ParcelValue in the name box. Click the Type dropdown and click ESRI Types:: esriFieldTypeInteger to set the field type. Click OK.

 

Also add another attribute CombinedBuildingValue.

 

Click the Tagged Values for the class

Click New to create a new tagged value*. Type GeometryType in the tag box. Type esriGeometryPolygon in the value box. Click OK. Click OK.

 

*Tagged values are used to specify geodatabase characteristics of the elements in the model, the geometry type of a feature class which are not supported in UML. Extensibility mechanism.

 

 

Create another class and add attributes as can be seen below.

 

 

Create relationship between Parcel and Building using composite relationship.

 

 

Double-click the relationship, and then specify End Name and Multiplicity as shown below.

 

Click the Tagged Values. Click New to add a new tagged value. Type OriginPrimaryKey in the tag box. Type OBJECTID in the value box. Click OK.

 

 

Create a second tagged value. Use OriginForeignKey as the tag and ParcelID as the value. Click OK.

 

Make sure your model is the same as below. Save the model.

 

 

 

Export a model to XMI

 

Specify the file path by choosing

Tools-Options-Advanced Tab-File Paths button

Type in the path to Add-ons like below

 

 

Choose Tools-Add-Ons-ESRI XMI Export

 

 

Type the name of new XML, Click Save to export the UML model.

 

You can check any error in your xml file by choosing Tools-Macros-ESRI-SemanticCheckers. Choose XMI file and click Check. You should get the message that says no error found.

 

 

 

Creating the schema

 

Copy uml.dtd (do not move!) from :\Program Files\ArcGIS\CaseTools\Uml\Utilities into the same directory where your xmi file is stored.

 

Create the working folder, say c:\temp\shwang5\CASE, and connect to this folder by clicking “Connect to Folder” button

Start ArcCatalog

Click Tools, then click Customize

Click the Commands tab

Click CASE Tools in the categories list

Drag the Schema Wizard command onto a toolbar

Click Close

 

 

 

Create your personal geodatabase by clicking right mouse button: New-Personal Geodatabase to which you will write schema from XMI

 

 

 

Give the name, say SampleDB

While choosing the geodatabase, click the Schema Wizard button

 

 

Click Next

Browse for the xml file you created

 

 

 

Click Next

 

Click Next, and then Finish. You just create object-oriented database based on your conceptual model.

 

You can browse through the database template by looking at the properties of each featureclass

as shown below.

 

 

 

Full documentations can be found at

1) how to build geodatabases with CASE tools

http://support.esri.com/index.cfm?fa=knowledgebase.documentation.viewDoc&PID=43&MetaID=658

2) how to install UML to XMI Export Facaility in Visio

http://support.esri.com/index.cfm?fa=knowledgebase.techarticles.articleShow&d=26105

 

-- END --